package com.gs.spring;

import java.util.Date;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

public class RequestSimpleBean {

	Date creationDate;
	
	@PostConstruct
	public void initialize(){
		System.out.println("Initializing bean " + getClass());
	}
	
	@PreDestroy
	public void cleanUp(){
		System.out.println("Cleaning up bean " + getClass());
	}
	
//	@Override
//	public String toString() {
//		return "Bean was created at " + new Date();
//	}
	
	RequestShoppingCartBean requestShoppingCartBean;
	
	@Autowired
	public void setRequestShoppingCartBean(
			RequestShoppingCartBean requestShoppingCartBean) {
		System.out.println("Injecting " + requestShoppingCartBean);
		this.requestShoppingCartBean = requestShoppingCartBean;
	}
	
	public RequestShoppingCartBean getRequestShoppingCartBean() {
		return requestShoppingCartBean;
	}
	
}
